﻿using HackApp.DataAccess;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Security;

namespace HackApp.BusinessLogic
{
  public class AppMembership : BusinessLogicBaseClass
  {
    internal AppMembership() : base() { }

    public MembershipUser CreateUser(string username, string password, string role)
    {
      MembershipUser user = Membership.CreateUser(username, password);
      if (!Roles.RoleExists(role))
      {
        role = MembershipRoles.USER;
      }
      Roles.AddUserToRole(user.UserName, role);

      return user;
    }



    //create(set role)
    //
  }
}
